home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SOUND.SWG / 0013_VOCINFO.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  70 lines

  1. {
  2.  I posted beFore about sample converting... the .VOC to the sample
  3.  Format used by MODS.  You gave me some example code, but the prob is,
  4.  VOC Files have a header, how would I do it so that the header wasn't
  5.  converted?
  6.  
  7. Here is the VOC File Format that was posted here a While back.  It works
  8. well For me.
  9.  
  10.  
  11. A .VOC File consists of a 26-Byte header Record plus sample data.
  12. The header Record has the following layout:
  13. }
  14. VoiceHeader  : Record
  15.      signature   : Array[1..20] of Char;   { Vendor's name }
  16.      DataStart   : Word;      { Start of data in File }
  17.      Version     : Integer;   { BCD value: min. driver version required }
  18.      ID          : Integer;   { 1-Complement of Version field+$1234 }
  19.    end;                       { used to indentify a .VOC File }
  20.  
  21. The data is divided into 'blocks'.  There are 8 Types of blocks:
  22.  
  23. -  0 : Terminator
  24.        1 Byte Record, value 00
  25.  
  26. -  1 : Voice Data
  27.        1 Byte, value 01: identifier
  28.        3 Bytes: length of voice data (len data + 2)
  29.        1 Byte: SR= 256-(1,000,000 / sampling rate)
  30.        1 Byte: pack field, value:
  31.          0 : unpacked, 1 : 4-bit, 2 : 2.6 bit, 3 : 2 bit packed
  32.        <follows voice data>
  33.  
  34. -  2 : Voice Continuation
  35.        1 Byte, value 02: identifier
  36.        3 Bytes: length of voice data
  37.        <follows voice data>
  38.  
  39. -  3 : Silence
  40.        1 Byte, value 03: identifier
  41.        3 Bytes: length of silence period (value 3?)
  42.        2 Bytes: silence period in Units of sampling cycles
  43.        1 Byte: SR (see above)
  44.  
  45. -  4 : Marker
  46.        1 Byte, value 04: identifier
  47.        3 Bytes: length of marker, value 2
  48.        2 Bytes: user defined marker
  49.  
  50. -  5 : ASCII Text
  51.        1 Byte, value 05: identifier
  52.        3 Bytes, length of String (not counting null Byte)
  53.        <String>
  54.        1 Byte, value 0: String terminator
  55.  
  56. -  6 : Repeat Loop
  57.        1 Byte, value 06: identifier
  58.        3 Bytes: length of block, value 2
  59.        2 Bytes: count value+1
  60.  
  61. -  7 : end Repeat Loop
  62.        1 Byte, value 07: identifier
  63.        3 Bytes: length of block, value 0
  64.  
  65. {
  66. to my knowledge, the .VOC File Format is proprietary and the data
  67. herein is only of value For the specific SoundBlaster hardware. I think
  68. you'll have a hard time converting samples to another synthesizer.
  69. }
  70.